package com.woniuxy.java102vuecli.controller;

import com.woniuxy.java102vuecli.entity.Department;
import com.woniuxy.java102vuecli.service.DepartmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author author
 * @Create 2023-09-14 12:01
 */
@Slf4j
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    @RequestMapping("/get/all")
    public ResponseResult<List<Department>> getAllDepartments(){
        return new ResponseResult<List<Department>>(200,"success",
                departmentService.getAllDepartments());
    }

}
